﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace HouseKeepingPL.HKService
{
    public partial class User: IDataErrorInfo
    {
         public string Error
        {
            get { throw new NotImplementedException(); }
           // get { return "Error Occured"; }
        }

        public string this[string columnName]
        {
            get
            {
                string result = null;
                if (columnName == "Username")
                {
                    if ( String.IsNullOrEmpty(Username.Trim()))
                    {
                        result = "Please enter user name!";
                    }
                }

                if (columnName == "Password")
                {
                    if (Password.Length < 3)
                    {
                        result = "Password must be more than 3 Chars";
                    }
                }

                return result;
            }
        }
    }
    
}
